|
ARD2
1.00 for Rev B. Hardware
Airbag Reference Demonstrator using MPC5604P
|
FreeMASTER Recorder implementation. More...
#include "freemaster.h"#include "freemaster_private.h"#include "freemaster_protocol.h"#include "freemaster_rec.h"Defines | |
| #define | CMP(v, t) ((FMSTR_BOOL)(((v) < (t)) ? 0 : 1)) |
| Compare macro used in trigger detection. | |
Typedefs | |
| typedef FMSTR_BOOL(* | FMSTR_PCOMPAREFUNC )(void) |
Functions | |
| void | FMSTR_InitRec (void) |
| Recorder Initialization. | |
| void | FMSTR_AbortRec (void) |
| Abort and de-initialize recorder. | |
| void | FMSTR_SetUpRecBuff (FMSTR_ADDR pBuffer, FMSTR_SIZE nBuffSize) |
| API: Replacing the recorder buffer with the user's one. | |
| FMSTR_BPTR | FMSTR_SetUpRec (FMSTR_BPTR pMessageIO) |
| Handling SETUPREC and SETUPREC_EX commands. | |
| void | FMSTR_TriggerRec (void) |
| API: Pull the trigger of the recorder. | |
| FMSTR_BPTR | FMSTR_StartRec (FMSTR_BPTR pMessageIO) |
| Handling STARTREC command. | |
| FMSTR_BPTR | FMSTR_StopRec (FMSTR_BPTR pMessageIO) |
| Handling STOPREC command. | |
| FMSTR_BPTR | FMSTR_GetRecStatus (FMSTR_BPTR pMessageIO) |
| Handling GETRECSTS command. | |
| FMSTR_SIZE | FMSTR_GetRecBuffSize () |
| Get recorder memory size. | |
| FMSTR_BOOL | FMSTR_IsInRecBuffer (FMSTR_ADDR dwAddr, FMSTR_SIZE8 nSize) |
| Check wether given memory region is inside the recorder buffer. | |
| FMSTR_BPTR | FMSTR_GetRecBuff (FMSTR_BPTR pMessageIO) |
| Handling GETRECBUFF and GETRECBUFF_EX command. | |
| void | FMSTR_Recorder (void) |
| API: Recorder worker routine - can be called from application's timer ISR. | |
Variables | |
| FMSTR_U16 | pcm_wRecTotalSmps |
| FMSTR_U16 | pcm_wRecPostTrigger |
| FMSTR_U8 | pcm_nRecTriggerMode |
| FMSTR_U16 | pcm_wRecTimeDiv |
| FMSTR_U8 | pcm_nRecVarCount |
| FMSTR_ADDR | pcm_pRecVarAddr [FMSTR_MAX_SCOPE_VARS] |
| FMSTR_SIZE8 | pcm_pRecVarSize [FMSTR_MAX_SCOPE_VARS] |
| FMSTR_U16 | pcm_wRecTimeDivCtr |
| FMSTR_U16 | pcm_wStoprecCountDown |
| FMSTR_REC_FLAGS | pcm_wRecFlags |
| FMSTR_U16 | pcm_wRecBuffStartIx |
| FMSTR_ADDR | pcm_dwRecWritePtr |
| FMSTR_ADDR | pcm_dwRecEndBuffPtr |
FreeMASTER Recorder implementation.
| #define CMP | ( | v, | |
| t | |||
| ) | ((FMSTR_BOOL)(((v) < (t)) ? 0 : 1)) |
Compare macro used in trigger detection.
| v | - original command |
| t | - response buffer |
| FMSTR_BPTR FMSTR_GetRecBuff | ( | FMSTR_BPTR | pMessageIO | ) |
Handling GETRECBUFF and GETRECBUFF_EX command.
| pMessageIO | - original command (in) and response buffer (out) |
This function returns recorder buffer information
| FMSTR_SIZE FMSTR_GetRecBuffSize | ( | void | ) |
Get recorder memory size.
| FMSTR_BPTR FMSTR_GetRecStatus | ( | FMSTR_BPTR | pMessageIO | ) |
Handling GETRECSTS command.
| pMessageIO | - original command (in) and response buffer (out) |
This function returns current recorder status
| FMSTR_BOOL FMSTR_IsInRecBuffer | ( | FMSTR_ADDR | dwAddr, |
| FMSTR_SIZE8 | nSize | ||
| ) |
Check wether given memory region is inside the recorder buffer.
| dwAddr | - address of the memory to be checked |
| wSize | - size of the memory to be checked |
This function is called as a part of TSA-checking process when the PC host is requesting memory contents
| void FMSTR_Recorder | ( | void | ) |
API: Recorder worker routine - can be called from application's timer ISR.
This returns quickly if recorder is not running, otherwise it calls quite lengthy recorder routine which does all the recorder work (sampling, triggering)
| FMSTR_BPTR FMSTR_SetUpRec | ( | FMSTR_BPTR | pMessageIO | ) |
Handling SETUPREC and SETUPREC_EX commands.
| pMessageIO | - original command (in) and response buffer (out) |
| void FMSTR_SetUpRecBuff | ( | FMSTR_ADDR | pBuffer, |
| FMSTR_SIZE | nBuffSize | ||
| ) |
API: Replacing the recorder buffer with the user's one.
| pBuffer | - user buffer pointer |
| wBuffSize | - buffer size |
| FMSTR_BPTR FMSTR_StartRec | ( | FMSTR_BPTR | pMessageIO | ) |
Handling STARTREC command.
| pMessageIO | - original command (in) and response buffer (out) |
This function starts recording (initializes internal recording variables and flags)
| FMSTR_BPTR FMSTR_StopRec | ( | FMSTR_BPTR | pMessageIO | ) |
Handling STOPREC command.
| pMessageIO | - original command (in) and response buffer (out) |
This function stops recording (same as manual trigger)
| void FMSTR_TriggerRec | ( | void | ) |
API: Pull the trigger of the recorder.
This function starts the post-trigger stop countdown